home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7079 < prev    next >
Encoding:
Text File  |  1996-08-05  |  915 b   |  46 lines

  1. Path: news.umbc.edu!ssopre1
  2. From: ssopre1@umbc.edu (Sunil )
  3. Newsgroups: comp.lang.c++
  4. Subject: [HLP] Easy Problem w/ Classes!
  5. Date: 21 Feb 1996 18:09:03 GMT
  6. Organization: University of Maryland, Baltimore County
  7. Message-ID: <4gfn3v$jp@news.umbc.edu>
  8. NNTP-Posting-Host: rpc16.gl.umbc.edu
  9. NNTP-Posting-User: ssopre1
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Hello all
  13.   Heres a little problem that I need help with. 
  14.  
  15. // Point.h contains
  16. Class Point {
  17. private: int x;
  18.      int y;
  19.  
  20. public: Point();
  21. }
  22.  
  23. // LineSeg.h contains 
  24. class LineSeg{
  25. private:
  26.     Point end;
  27.     Point start;
  28. public:        
  29.     LineSeg();
  30. }
  31.  
  32. // LineSeg.C contains
  33. LineSeg::LineSeg()
  34. {
  35.  Point.end.x=0;  // Are these valid? 
  36.  Point.end.y=0;  // What do I need to add/del here? 
  37.  Point.start.x=0;
  38.  Point.start.y=0;
  39. }
  40.  
  41. Basically, LineSeg() is supposed to set starting and ending
  42. points to zero. Compiler goes berserkoid .. . 
  43. --
  44. -sunil
  45. Suicide : Practice till I'm perfect
  46.